//
//  DockMoreButton.m
//  团购
//
//  Created by 樊荣海 on 15/1/20.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//

#import "DockMoreButton.h"

@implementation DockMoreButton

- (instancetype)initWithFrame:(CGRect)frame {

    if (self == [super initWithFrame:frame]) {
        
        [self setImage:@"ic_more" selectedImage:@"ic_more_hl"];
        
        //[重要]底部固定, 自动调节与顶部的间距
        self.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
        
        [self addTarget:self action:@selector(moreClick) forControlEvents:UIControlEventTouchDown];
    }


    return self;
}

- (void)moreClick {
    
    self.enabled = NO;

    MoreTableViewController *more = [[MoreTableViewController alloc] init];
    more.moreButton = self;
    BaseNavigationController *more_navi = [[BaseNavigationController alloc] initWithRootViewController:more];
    
    more_navi.modalPresentationStyle = UIModalPresentationFormSheet;
    
    [self.window.rootViewController presentViewController:more_navi animated:YES completion:nil];
}


@end
